Effect of mobile food environments on fast food visits

Poor diets are a leading cause of morbidity and mortality. Exposure to low-quality food environments saturated with fast food outlets is hypothesized to negatively impact diet. However, food environment research has predominantly focused on static food environments around home neighborhoods and generated mixed findings. In this work, we leverage population-scale mobility data in the U.S. to examine 62M people’s visits to food outlets and evaluate how food choice is influenced by the food environments people are exposed to as they move through their daily routines. We find that a 10% increase in exposure to fast food outlets in mobile environments increases individuals’ odds of visitation by 20%. Using our results, we simulate multiple policy strategies for intervening on food environments to reduce fast-food outlet visits. This analysis suggests that optimal interventions are informed by spatial, temporal, and behavioral features and could have 2x to 4x larger effect than traditional interventions focused on home food environments.


List of Supplementary figures
Foursquare dataset and Infogroup's US Historical Business Data for 2016 (17). . . .S4 Method to detect the change of context before lunch.We construct a binary time series for each of the census tracts for those users that have more than 30% of their contexts in two of them.We use a statistical test to detect statistically significant changes in the mean of those time series to know if and where changepoints happened.For the user in panel A, a significant change in the means (in red) is detected in December.However, for the user in panel B, no significant change is detected, and the user changes often between contexts.Statistically significant changes were detected using the changepoint library with a manual method and penalty of n 1/10 (see details of those methods in (18)). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .S5 A) Correlogram between the different demographic variables used in our regressions.
B) Result of the multivariate regression for the home and mobile food environments and the fraction of visits to FFO fitting a model using all demographic variables, see Eq. (2).C) Result of the univariate regression for the home and mobile food environments and the fraction of visits to FFO using only a given demographic variable (see text). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .S6 A: Spatial autocorrelation of ϕ(x), as a function of the distance in km.B: change in odds of visit to an FFO at different distances between the context and the lunch action when the context includes 10% more FFO, obtained from the results in Table S6.C: Distribution of the distance between the context and the lunch action.The vertical dashed line corresponds to d it = exp(3.335/2.091),see Table S6, and the horizontal line in B corresponds to the value of the model in the main text for all distances (∼ 20%). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .S7 Left: Effect of the mobile food context ϕ in choosing an FFO using logistic regression and hot-encoding different values of ϕ.Error bars are standard errors of the coefficients.Right: Effect of the mobile food context in choosing an FFO restricted to the food outings of different socio-demographic groups.Groups are selected as quantiles of each socio-demographic variable. . . . . . . . . . . . . . . . . . . . . . . . . . .S8 Importance of the FFO context variable ϕ(c it ) for models built with actions at different hours of the data.Variable importance is given by the absolute value of the t-statistic of the variable in the regression model (2) by the hour. . . . . . . . . . . . . . . . .S9 Correlation between the predictions for the total number of FFO visits (A and B) and fraction of FFO visits (C and D) of our model Eq. ( 2) and real data for the train (A and C) and test (B and D) sets in the two different out-of-sample strategies. . . . . .S10 Variation of different metrics to estimate the optimal number of topics in the different census tracts.Metrics were obtained using the ldatuning package (23).As we can see, several metrics show a minimum/maximum around k = 20. . . . . . . . . . . .S11 Composition of the different k = 20 POI topics found in our census tracts.We have given names to each of them for easy recognition.Bars represent the probability of finding each POI category in each of the topics.Note: no mobility data or visits were used in this analysis, only the spatial distribution of POIs from the Foursquare API. .S12 Average (and standard error of the mean) frequency of each topic across all census tracts in our dataset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .S13 Effect of the intervention strategies on the different health outcomes groups.Each panel shows the total increase in the number of non-FFO visits after the intervention for users belonging to different health risk groups (shades).We classify each individual into different groups of health outcomes depending on which quantile their census tract is with respect to that outcome (darker shading for higher quantiles of each health outcome group).Health outcomes by census tract are obtained from the PLACES Local data for Better Health dataset from the CDC (5). . . . . . . . . . . .S14 Effect of the mobile food context ϕ in choosing and FFO using the logistic regression Eq. ( 2

Supplementary Note 1: Data
The mobility data were obtained from Spectus, a location intelligence, and measurement company.The dataset consists of anonymized records of GPS locations from users who opted-in to share the data anonymously in the US metropolitan areas over a period of 6 months, from October 2016 to March 2017.Data was shared in 2017 under a strict contract with Spectus through their Data for Good program, where they provide access to de-identified and privacy-enhanced mobility data for academic research and humanitarian initiatives only.All researchers were contractually obligated not to share data further or to attempt to de-identify data.Mobility data is derived from users who opted in to share their data anonymously through a General Data Protection Regulation (GDPR) and California Consumer Privacy Act (CCPA) compliant framework.

Extracting stays
From the data, we extracted the "stays", as the places x i,t where anonymous user i stayed (stopped) at time t for at least ∆t roam minutes using the algorithm proposed by Hariharan and Toyama (14).In that algorithm, a set of consecutive pings are clustered together if their maximum distance from their centroid x i,t is not larger than some roaming distance ∆l roam .The duration of a stay τ (x i,t ) is then the time between the first and last ping belonging to a cluster.Here, as in (22; 16), we use ∆l roam = 50 meters and ∆t roam = 5 min.Shorter stays cannot be detected with enough precision by our algorithm.Furthermore, we want to discard people just passing by or stopping for a short time close to the food place.To discard stays related to working places, we only considered stays of less than 2 hours of duration [τ (x i,t ) < 2 hours].Only 5.83% of the visits to food outlets are discarded with this last filter (see Figure S1).

Attribution of stays to POIs
To identify if a stay happens in a particular place, we use a dataset of 1.2 Million Points-of-Interest (POI) in US metropolitan areas collected using the Foursquare API in 2017.We use the Foursquare venue categorization of the places to detect the type of place visited (12).Some of those POIs are classified as Food Outlets (FO) and Fast Food Outlets (FFO); see Supplementary Note Supplementary Note 3:.Like stays, each POI is also represented by a single point in space.To attribute a stay to a POI, we simply attribute each stay to the closest POI in our dataset.Despite its simplicity, this strategy works well for inferring visited places from sparse, low-accuracy mobile data (8).To avoid attributing a stay to a distant place, we choose only the closest place within a radius of d max = 200 meters.However, we find that the median distance of stays attributed to POI is 24.24 m (Interquantil Range, IQR, 12.21 -49.17), and the median distance of a stay attributed to FO is 18.82 m (IQR, 9.74 -30.335m) and the median distance of a stay attributed to FFO is 17.70m (IQR, 9.257 -31.88m).All of them are much smaller than d max .Nevertheless, we have tested that our results are largely independent of and robust to our approach for attributing stays to POI, see Supplementary Note 12.1.

Identifying home
Finally, we estimate the home Census Block Group of the anonymous users as that in which they are more likely located during nighttime.For each smartphone, we use its stays from 22:00 to 06:00 and spatially cluster them using the Density-based Spatial Clustering of Applications with Boise (DB-SCAN) algorithm (11) to detect the most likely cluster of stays each anonymous user is located in during nighttime and early morning hours.We use 5 as the minimum number of points per cluster and ε = 30 meters as the neighborhood distance in the algorithm.We only consider individuals who were at their home cluster for at least 10 nights in the observation period.The Census Block Group that contains that cluster is identified as the users' home.We also discard stays happening closer than 50 meters from users' home locations.

Definition of metro areas
We only considered mobility data that happened within 11 metropolitan areas defined as the Corebased Statistical Areas (CBSA) (1), see Table S1.We considered CBSAs instead of other geographical units since they are areas that are socioeconomically related to an urban center.This provides a selfcontained metropolitan area in which people move for work, leisure, or other activities.Note that most of the CBSAs we consider span several states.

Descriptive analysis of the data
Table S1 and Figure S1 show different summaries of the data used in the analysis.In particular, we show the distribution of stay duration for different types of POIs, the distribution of the number of stays per user, and the distributions of µ i , ϕ m i and ϕ h i for each individual.Figure 1B in the main text shows the distributions of the distance traveled to all visits and different food venues.Table S1 shows the number of points in those distributions.The number of points for the grocery stores visits is 1.96 million points.In our dataset, we find that the median distance from home h to any place visited x is 7.83km (Interquartile Range, IQR, [2.47km -18.63km]).For the rest, we found: • The median distance to any food venue visited is 6.94km (IQR [2.30km -17.23km]).The Mann Whitney U-Rank test showed that the difference with visits to all places is significant (p − value < 0.001 and effect size (rank biserial) r = 0.03 with 95% confidence interval [0.03, 0.03]).
• The median distance to any fast food venue visited is 6.74km (IQR [2.50km-16.62km]).The Mann Whitney U-Rank test showed that the difference with visits to all places is significant (p − value < 0.001 and effect size (rank biserial) r = 0.02 with 95% confidence interval [0.02, 0.03]).
More details about how the data was constructed, its representativity, and comparison with other datasets can be found in references (16; 22) and Supplementary Note Supplementary Note 2:.In particular, as found in (22), our sample of users and their behavior is highly representative of the people living in those metropolitan areas, including their socio-demographic profile and the visitation patterns to different amenities.Also, in (16) we found that neighborhood-level features representing visits to fast food outlets (FFO) were significantly associated with self-reported fast-food intake, significantly associated with obesity and diabetes, and were a better predictor of these diseases than self-reported fast food intake.

Other data used
Demographic characteristics for each Census Block Group were obtained from the American Community Surve (5 years) 2017 edition (28).Each demographic characteristic is in a given table .In our study we used the following demographic characteristics (by CBG): • Proportion of Black population in the CBG, Table C02003.
• Proportion of people with a college education or beyond, Table B15002.
• Proportion of people working in low-skill jobs, namely in the Agriculture, Construction, Manufacturing, Wholesale, Retail, and Transportation sectors.Table C24030.
• Proportion of people commuting longer than 45 minutes, Table B08303.
• Proportion of people that use public transportation for that commuting, Table B08301.
• Median income of each household, Table B19013.
Census tract-level estimates for different health risk behaviors and outcomes were obtained from the 2017 edition of the PLACES Local data for Better Health dataset from the CDC (5).The data is public and contains prevalence levels of different chronic diseases and health risk behaviors like Diabetes or Physical Inactivity by census tract.Estimations of those prevalence levels are only available for a given set of cities, but it overlaps with the cities in our study.
Finally, Low-Income, Low-Supermarket-Access (LILA) Census tracts were obtained from the 2015 version of the Food Environment Atlas made by the U.S. Department of Agriculture (10).In particular, we consider the LILA tracts cataloged by the U.S. Department of Agriculture as LILA 1-and-10 (flag for food desert), which are those that have low-income and low accessibility to supermarkets measured at 1 mile for urban areas and 10 miles for rural areas.

Supplementary Note 2: Representativity
Our location data comes from smartphones in large urban areas.Although a large proportion of the U.S. population owns a smartphone in urban areas, we might question whether our sample of 1.8 million devices is representative of the population and different socio-demographic groups in that area.Figure S2 shows the comparison between the population detected in our data and the census data.As we can see, the correlation is high (ρ = 0.59 ± 0.01) by census tract, showing that we get a good representation of the population.Despite that, similar to reference (22) we address the representativity of the data using a weighting mechanism (post-stratification) based on w Ω i , the ratio of smartphone users to the true population in census tract Ω i where user i lives (26).We tested that our main results do not depend on this post-stratification technique.In particular, as we can see in figure S2b if we weigh the data in the logistic regression model ( 2) by the inverse of the ratio, we get very similar results to the raw data.Still, the impact on the environment is of the same magnitude as the main results presented in the paper.Similar results are obtained when we re-weigh the effect of different interventions by the inverse of the ratio of smartphone users to the true population.In Figure S2c, we compare the effect of different interventions on our sample of users, compared with the weighted version: As we can see, the relative results between the different interventions are similar between the weighted and non-weighted (raw) data.But obviously, the numbers are scaled to population levels.

Supplementary Note 3: Classification of Food Outlets
Food visits were defined as visits to a location where food might be sold (including restaurants, food retailers, and other locations).We extend the idea in (7) and identify Food Outlets (FO) using a combination of Foursquare's existing categorization taxonomy (12).Each place in the Foursquare dataset belongs to a parent category (e.g., "Food" or "Arts & Entertainment").In particular, FO are defined as those in the "Food" parent category, but we also include other places that serve or sell food that happen in other parent categories, probably due to misclassifications or FO within multipurpose facilities (e.g., music venues that serves food).A detailed description of those combinations appears in Table S2.For privacy reasons, we have excluded FO located at schools, drug stores, or medical facilities.
To identify Fast Food Outlets (FFO) we use the name of the venue and match it to the list of Fast Food restaurant chains in the US from the Wikipedia (33).We augmented that list to get common names like "KFC" instead of the official "Kentucky Fried Chicken".And to account for potential different spellings of the name (e.g."Carl's Jr" instead of "Carl's Jr. / Green Burrito") we used approximate string matching between the name of the venue and the list in the Wikipedia using the Jaro-Winkler distance (6) of the stringdist library (29).To test how good is this classification of FFO, we compare it with the manual annotation of FFO for the LA metro area in (16), which used a combination of Foursquare's existing FFO categorization taxonomy and a bottom-up search of known chain FF outlet names validated in previous research (9) and string matching techniques.We found that 94% of the places annotated as FFO in (16) were included in our automatic classification.However, our classification contains more FFO (6964) than those in (16) (4151) in LA, because some major chains like "Chipotle" or "Starbucks" were not considered FFO in (16).In Section Supplementary Note 12: we check extensively that our results do not depend on the definition and set of FFO considered.
Finally, our Foursquare dataset is an accurate representation of the fast-food outlets in each city.As we can see in Figure S3, the number of FFO detected in each city by fast-food chains has a strong correlation with other (curated) datasets of business, like the Infogroup's US Historical Business Data for 2016 (17).The small variation between them can be attributed to the different ways an outlet is defined in both datasets.Also, in our dataset, we can detect food outlets within businesses (e.g., coffee shops in large stores) which do not appear in Infogroup's dataset.We construct a binary time series for each of the census tracts for those users that have more than 30% of their contexts in two of them.We use a statistical test to detect statistically significant changes in the mean of those time series to know if and where changepoints happened.For the user in panel A, a significant change in the means (in red) is detected in December.However, for the user in panel B, no significant change is detected, and the user changes often between contexts.Statistically significant changes were detected using the changepoint library with a manual method and penalty of n 1/10 (see details of those methods in (18)).a different context if the change never happened.In the modeling, we used the default values of the CausalImpact library, including no seasonality, since our time series are centered 50 days around where they change their context.Supplementary Note 7: Models 7.1 Demographic models for exposure to home and mobile food environments and FFO visits To investigate the socio-demographic differences in home and mobile exposure to fast food, and in the fraction of FFO visit decisions, we have used simple linear regression models like: where d l,i are the different socio-demographic variables associated with the home Census Block Group (CBG) where user i lives, and MSA i is a fixed factor by urban area.The socio-demographic variables considered are listed in Section Supplementary Note 1:.To prevent large fluctuations in the fraction of Table S3: Results for the Ordinary Least Squares regression of mobile (ϕ m i ), home (ϕ h i ) average exposure to FFO environments, and the fraction of FFO visits (µ i ) by individual, as a function of different socio-demographic traits of the census tract where individuals live.The table presents the estimated coefficients with their respective standard errors in parentheses.p-values correspond to twosided tests for the hypothesis that each coefficient is different from zero.95% Confidence intervals for R 2 were obtained through bootstrap with 200 realizations.FFO visits or exposure due to small numbers in the number of visits, in our models we only consider users with more than 50 stays (see Figure S1).Table S3 shows the results of the linear regression for each variable.As we can see, despite many of the coefficients being significant, only the model for ϕ m has some explanatory power with R 2 = 0.21.Interestingly, the fraction of FFO visits and exposure at home models do have a very small explanatory variable.Note also that, as mentioned in the main text, using bootstrap methods we can see that the difference between the models for ϕ m i and ϕ h i is statistically significant at 95% level.Note that our models are multivariate.Thus the correct interpretation of the results in Table S3 is that the coefficient estimate for each demographic variable measures the association of that demographic variable conditioned on the rest of the variables kept constant.However, demographic variables are not independent, and that cannot be done without affecting the variable itself.As we see in Figure S5, demographic variables like income, education, employment, or low-skill jobs for

Estimate
Home FF Environment

Mobile FF Environment
Fraction of visits to FF

Univariate regression C
Figure S5: A) Correlogram between the different demographic variables used in our regressions.B) Result of the multivariate regression for the home and mobile food environments and the fraction of visits to FFO fitting a model using all demographic variables, see Eq. ( 2).C) Result of the univariate regression for the home and mobile food environments and the fraction of visits to FFO using only a given demographic variable (see text). each CBG are moderately correlated.For that reason, results for a single univariate model like ϕ m i , ϕ h i , µ i ∼ β l d l,i + MSA i are different for some of those variables, see Figure S5.Especially significant are cases like the relationship between educational attainment and the fraction of FFO in neighborhoods.As we can see, the univariate relationship is negative (more educational attainment in the neighborhood is related to less FFO in that neighborhood), as expected.However, when we perform the multivariate regression (1), we get that the coefficient is positive, a result of the complex correlational structure of the variables mentioned before.
We have also tested the possibility that demographic variables have better explanatory power using non-linear models to explain home and mobile exposure to fast food.To this end, we have implemented random forest models similar to Eq. (1).Since many users share the same ϕ h i for the same demographic variables, to prevent overfitting in that case we have trained the model for ϕ h i using a set of home census tracts different than the ones used in testing the model.Our results for non-linear regressions are very similar to the linear ones: we get R 2 = 0.288 for ϕ m i , R 2 = 0.048 for ϕ h i , and R 2 = 0.055 for µ i (compare to those in Table S3).Although performing slightly better than linear models, our results show that demographic variables have small explanatory power for both the home and mobile environments.More importantly, more sophisticated models show the small dependence of visits to FFO (µ i ) with demographic variables.

Model for visits to FO during Lunchtime
To test for the effect of FFO environments, we have run a number of statistical models.For the main results of the paper, we establish the effect of FFO environments around the contexts to go to a FFO place using logistic regression for the probability that the user i went to a FFO at time t, i.e., y it = 1.

Pr(y
where logit −1 (x) = e x /(1 + e x ), and ϕ(c it ) is the fraction of FFO options around the context before lunch.We control individual preferences and daily patterns by introducing a fixed effect by user (α i ) and day (δ t ).Regression was only performed for those individuals or days that have at least one FFO and non-FFO visit.Results for this model are presented in Figure 2 of the main paper and Table S4.We also cluster errors by day to account for potential heterogeneity; see Table S4.
Table S4: Logistic regression results for the model in Equation ( 2) for different groups of users and food outings.The last column corresponds to the model in Equation ( 4) for the DMV visits.The table presents the estimated coefficients with their respective standard errors in parentheses.p-values correspond to two-sided tests for the hypothesis that each coefficient is different from zero.We also report the Squared Correlation and Pseudo R 2 results for the logistic regression, and the Accuracy in the training of the model and its 95% confidence interval in square brackets.To observe potential non-linearities in the effect of FFO, we used a logistic regression where we one-hot encoded the rounded version of ϕ(c it ).This allows us to observe whether the effect they have is linear, or has another shape.The coefficient for each value of ϕ can be seen in figure S7.The effect is always increasing, and it is almost linear, as we hypothesize in Equation (2).
We have also checked the performance of the model at different distances from home.As we can see in Table S5, we still see a strong impact of the context in the decisions to visit FFO.Note, however, that as decisions are made close to home, the impact of the mobile food environment is smaller.This reflects slightly different consumption behaviors at home and on the move.However, as we can also see, most of the food outings happen away from home, where the context is more important to make the decision to visit FFO or not.
In our model, we have considered decisions y it , which are done away from the pre-lunch context.For our lunchtime dataset, the distance from home to the FO visit has a median of 9.78km, while the median from the context is only 1.60km.Despite that, we get a number of actions y it that happen far away from the context.One important question is how the context influences those decisions that are taken far away; that is, what is the role of the distance between the context of action in the food choice?This could be entangled with the question of how food environments are spatially correlated.
If ϕ(x) has a large spatial correlation, we might find that the context is still important to explain decisions taken far away from it.However, as figure S6 shows, the spatial correlation of ϕ(x) decays dramatically after 1km.Thus the food environments where the decision and action are made are very different in terms of FFO options.
To understand better the role of distance in the effect of the context, we have modified the model (2) to include the distance as a modulating factor in the effect of the food environment: where log d it is the (log-)distance between the context before lunch c it and the food outlet where lunch happened.Results are presented in table S6, where we can still see that the effect of the context is strong β = 3.335 (0.0541) but is modulated by the distance.The interaction effect is negative meaning that, as expected, for larger distances the impact of the context is smaller, and it could be even negative for larger distances.In particular, we find that the effective log-odds become negative when d it > exp(3.335/2.091)≃ 4.93km (see Figure S6B).This might be because people who travel such large distances between context and action probably go to places that are very different from the context (see Figure S6A).In any case, the heterogeneity of the coefficients at different distances should be viewed as merely correlational, meaning that when people travel far from their context to go for lunch, their meal decision is less correlated with their context than when they travel less.S6, and the horizontal line in B corresponds to the value of the model in the main text for all distances (∼ 20%).
However, for the majority of our data, the distance d it is smaller than 5km (only 15% of it has d it > 4.93km., see Figure S6C).Thus, for a large majority of the actions in our dataset, we still get that the impact of the context is positive: more FFO in the context increases the probability that the lunch action is a visit to an FFO.

Model for visits to FO by socio-demographic traits
We have also tested whether the effect of the context could be accounted for the different contexts that individuals visit depending on their socio-demographic traits.As we can see in Figure 2 in the main paper, people that rely more on public transportation and long commuting, with low-skill jobs, and from predominantly Black neighborhoods seem to be exposed to more FFO.However, as we see in Figure 2 and Figure 3 in the main paper, the FFO context and its effect seem to be largely independent of income.Rather than introducing complicated interaction terms, to test other demographic variables in the effect of the context, we have rerun the logistic regressions only for the visits to FO of particular socio-demographic groups, specifically by quantile of the different socio-demographic variables.As we can see in Figure S7, although there is some variability, our estimations of β are very similar across different socio-demographic groups.
Table S6: Logistic regression results for the model in Equation.(3).The table presents the estimated coefficients with their respective standard errors in parentheses.p-values correspond to two-sided tests for the hypothesis that each coefficient is different from zero.Note that d it is the (log-)distance between the context and the food place where lunch happened.β (log-odds)

Hour Importance of the context variable
Figure S8: Importance of the FFO context variable ϕ(c it ) for models built with actions at different hours of the data.Variable importance is given by the absolute value of the t-statistic of the variable in the regression model ( 2) by the hour.

Model for the visits to FO after DMV
In the case of visits to DMV, we typically have only one observation and day per user.Thus we have removed the daily and individual fixed factors and we have used a simpler logistic regression model: where αi is the observed fraction of visits to FFO for each individual i.

Model for the visits to FO during the whole day
Finally, we have extended the model (2) to the rest of the day.To this end, we consider each food visit and find the previous (non-food) stay within two hours in the past as the context c it .Then we fit a similar model as that in Eq. ( 2).This allows us to investigate also at what time of the day the context is more important to determine the type of food visit.As we can see in Figure S8, the importance of the context variable ϕ(c it ) measured by the t-statistic in the regression model ( 2) is larger around noon.Thus, visits around noon are more likely to be affected by the local context where individuals were previously.Since this model for the whole day is used in our estimation of the effect of interventions, we have also investigated its performance in predicting users' behavior.Table S7 shows the accuracy of the logistic regression model during training and testing under different out-of-sample situations.
• Individual out-of-sample: In the first analysis, we considered the usual out-of-sample test in which a random fraction of actions were removed when training the model and used later to measure model performance for unseeing actions.
• Geographical out-of-sample: We have also considered a geographic out-of-sample test in which we trained the model only on the actions in a fraction of census tracts and used the actions in the remaining census tracts as a test set.This way, the model was trained without incorporating any information about the environments in census tracts in the test group.That is, we test then the performance of the model when users are subject to unseen or different environments, a situation similar to our interventions.
In both cases, we have chosen 75% for the fraction in the train set and 25% for the test set.As we can see in Table S7 the model achieves high performances (accuracies in the test set around 80%) in both cases at the level of individual actions.But since our analysis of interventions is based on the total number of visits to FFO by area, our results critically depend on the performance of the model at the level area.To evaluate that performance by area we have compared the predictions of our model for both out-of-sample strategies on the total number and fraction of FFO visits by area.The results in Figure S9 show that the model achieves highly accurate predictions.Of special importance is the accuracy in the geographical outof-sample: training the model in some areas is able to capture both the individual preferences and the effect of the food environment so well that when we use the model to predict the visits to FFO in totally different areas, the correlation between the real data and our predictions is around 95% for the total number of visits to FFO and around 70% for the fraction of FFO.
Although our logistic regression model is quite accurate, we have tried other non-linear models (like Random Forest) to see if they have better performance.However, we get worse prediction accuracy (around 60% for random forest) compared with logistic regression.This is expected, given that random forest regressions are worse than logistic ones when the number of variables used as regressors is small (20).Also, as we see in Figure S7, the effect of the context is almost linear with ϕ(c it ), something which is already accounted for in linear models like the logistic regression.
In summary, our logistic regression model, Equation (2), has high accuracy in predicting visits to FFO at individual and, more importantly, at a given geographical area.

Supplementary Note 8: Topic analysis of census tracts
To identify the type of areas where the most efficient interventions happen, we have used topic modeling to identify the different patterns behind the distribution of POIs by area.We note that mobility data or visits were not used in this analysis, only the spatial distribution of POIs from the Foursquare API.Similar to LDA applied to text classification, we describe every census tract by the number of POIs in each category (terms), and we have applied Latent Dirichlet allocation (LDA) to get a small number of groups of POIs (topics) to describe each census tract (document) (3).For our analysis, we have only considered those categories that appear at least in 20 or more census tracts, so we ended up with a document-term matrix of 18898 census tracts with 614 categories of POIs.
The result of the LDA applied to that document-term matrix are two matrices: one containing the weights of the different categories by topics and the other containing the probabilities of finding a specific topic within each census tract.To find the number of topics, we have used different metrics found in the ldatuning package (23).Results for this tuning are found in figure S10 where we can see that we get (almost) global minima and maxima for different metrics around k = 20.
The composition of the different topics can be found in figure S11.As we can see, the topics are easily recognizable, and we have given names to each of them for easy recognition.They go from groups of POIs related to airports, offices, industrial / factory areas, shopping centers, malls, health R = 0.98, p < 2.2e-16   Figure S10: Variation of different metrics to estimate the optimal number of topics in the different census tracts.Metrics were obtained using the ldatuning package (23).As we can see, several metrics show a minimum/maximum around k = 20.
Table S7: Logistic regression results for the model in Equation ( 2) for all actions throughout the day and different out-of-sample test settings.The table presents the estimated coefficients with their respective standard errors in parentheses.p-values correspond to two-sided tests for the hypothesis that each coefficient is different from zero.We also report the Accuracy in train and test groups and its 95% confidence interval in square brackets.areas, education, and recreational areas, to more local ones related to different types of neighborhood groups of POIs.Each census tract can be described then by the set of frequencies of each topic within them.Most of the census tracts cannot be described uniquely by a single topic but by a weighted composition of them.As expected, we find that topics like "University" or "Airport" or "Seaside" are less frequent in census tracts than others like "Garage", "Shopping Center" or "Neighborhood", see figure S12.
In summary, our LDA method allowed us to characterize each census tract by the patterns or groups of different POIs we could find there.It is interesting to see that the POIs in almost twenty thousand census tracts can be described by only 20 different groups of POIs that co-occur frequently in our urban areas.Most of those groups/topics are related to commercial activities, but some of them describe working places, recreational or health areas too. Figure S13: Effect of the intervention strategies on the different health outcomes groups.Each panel shows the total increase in the number of non-FFO visits after the intervention for users belonging to different health risk groups (shades).We classify each individual into different groups of health outcomes depending on which quantile their census tract is with respect to that outcome (darker shading for higher quantiles of each health outcome group).Health outcomes by census tract are obtained from the PLACES Local data for Better Health dataset from the CDC (5).for the logistic regression are presented in Figure S17 where we can see that different definitions of c it yield very similar results on the effect of the context in fast food visits.These results indicate that our main findings are largely independent of and robust to the details of the definition of the context.

Different characterization of the context
To characterize the mobile food environment through the variable ϕ(x), we have taken the ratio of FFO to FO in a radius of 1km around place x.However, in highly dense areas with many FO, a radius of 1km can include many FO, and it will be less likely that people are using the whole information about that large area when making their decision.Thus, we have tested the sensitivity of our results to other definitions of ϕ(x), which account for the different densities of FO in different areas.In particular, we have tested taking ϕ(x) as the ratio of FFO to FO of the closest 25 FO to x, a definition that takes into account the density of FO around a place.As we can see in Figure S17, our results are very similar for both definitions.
We have also tested the possibility that rather than the absolute value of the fraction of FFO, users' decisions are conditioned by the relative number of FFO in the context to the whole city or county where the decision is made.That is that the users made decisions according to the excess of FFO in an area relative to the FFO in the whole county or city.To this end, we have modified model (2) as follows: Pr(y it = 1) = logit −1 [β 0 + α i + δ t + βϕ(c it ) + A it ] where A it is the county or the MSA where the decision is made.Results for the different areas are shown in table S8 where we can see that the results of model Eq. ( 5) are very similar to those presented in the main paper using model Eq. ( 2).These results indicate that our main findings are largely independent of and robust to the details of the characterization of the context.

Different sets of FO and FFO
Since there is little consensus about what is the definition of FFO, we test the robustness of our results to different definitions of food and fast food venues.In particular, we use three different definitions: • WF (Wikipedia and Foursquare) definition, the one used in the main paper and described in Section Supplementary Note 3:.
• MF (Manual and Foursquare) definition, the one used in (16) for the Los Angeles metropolitan area, see Section Supplementary Note 3:.
• WF+ (Wikipedia and Foursquare extended), which is similar to the WF definition but also adds in all independent restaurants that have the words "pizza" or "burger" in their names, as was done in (7).
As we can see in Figure S18, our results for the effect of the mobile food environment on the individual decision to visit FFO are very similar across the different definitions.We note, however, that the effect seems to be larger for the MF definition, due to the restrictive definition made in (16) for an outlet  Each group corresponds to a different quartile in each metropolitan area for the % of population with High Education, % of population using public transportation for work, % White population, and median household income.Quartile group 1 correspond to the lowest value and group 4 to the largest value of those demographic traits.
S1 A: Distribution of stay duration (in minutes) in our dataset for all POI, only those attributed to food POI and fast food POI.Vertical lines correspond to the minimum (5 min) and maximum (2 hours) used in our analysis.B: Density of the number of stays per user and type of POI.The vertical line corresponds to 50 stays used in our models for individuals.C: Density of the ratio of FFO to FO visited for each individual.D: Density of the mobile food environments and home environments for each individual.S2 A) Correlation between the smartphone population detection in our mobility data and the official census population by census tract.B) Coefficients of the logistic regression coefficient without (raw) and with (weighted) weights in the regression proportional to 1/w Ω i .C: Effect of the different interventions re-weighted by 1/Ω i to account for the different ratio of users to the population in each census tract Ω. . . . . . . . . . .S3 Comparison between the number of FFO by chain in different cities obtained from our ) by city as a function of the average value of ϕ(c it ) by city.Error bars for the mean of ϕ by city are smaller than the symbol size. . . . . . . . . . . . . . . . . . .S15 Total effect of each intervention strategy in each different city.Shades correspond to the number of actions changed by different income quantiles.See Figure 4 in the main text for more information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .S16 Effect of the mobile food context in choosing a food outlet at lunchtime for different types of food.Values show the coefficient β (log-odds) in Eq. (2), and bars indicate its standard deviation.The main result in the paper corresponds to the "Fast Food" type.S17 Effect of the mobile phone context in choosing a FFO when going to a food place at lunchtime for different definitions of FFO for different attributions of the stays to the POI and the choice of the stay for the context before lunch.Values show the coefficient β of the logistic regression (log-odds) in Eq. 2) and bars indicate its standard deviation.The result in the main paper corresponds to 200m, within a 1km radius and last stay.S18 Left: Effect of the mobile phone context in choosing a FFO when going to a food place at lunchtime for different definitions of FFO.The analysis is only made for the Los Angeles metropolitan area since the manual definition in (16) is only available there.Values show the coefficient of the logistic regression (log-odds) in Eq. (2), and bars indicate its standard deviation.Right: Number of FO and FFO in the different definitions of fast food outlets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .S19 Correlation between home and mobile food environments for different demographic groups.Each group corresponds to a different quartile in each metropolitan area for the % of population with High Education, % of population using public transportation for work, % White population, and median household income.Quartile group 1 correspond to the lowest value and group 4 to the largest value of those demographic traits. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Figure S1 :
Figure S1: A: Distribution of stay duration (in minutes) in our dataset for all POI, only those attributed to food POI and fast food POI.Vertical lines correspond to the minimum (5 min) and maximum (2 hours) used in our analysis.B: Density of the number of stays per user and type of POI.The vertical line corresponds to 50 stays used in our models for individuals.C: Density of the ratio of FFO to FO visited for each individual.D: Density of the mobile food environments and home environments for each individual.

C
Figure S2: A) Correlation between the smartphone population detection in our mobility data and the official census population by census tract.B) Coefficients of the logistic regression coefficient without (raw) and with (weighted) weights in the regression proportional to 1/w Ω i .C: Effect of the different interventions re-weighted by 1/Ω i to account for the different ratio of users to the population in each census tract Ω.

Figure S3 :
Figure S3: Comparison between the number of FFO by chain in different cities obtained from our Foursquare dataset and Infogroup's US Historical Business Data for 2016 (17).

Figure S4 :
FigureS4: Method to detect the change of context before lunch.We construct a binary time series for each of the census tracts for those users that have more than 30% of their contexts in two of them.We use a statistical test to detect statistically significant changes in the mean of those time series to know if and where changepoints happened.For the user in panel A, a significant change in the means (in red) is detected in December.However, for the user in panel B, no significant change is detected, and the user changes often between contexts.Statistically significant changes were detected using the changepoint library with a manual method and penalty of n 1/10 (see details of those methods in(18)).

Figure S6 :
Figure S6: A: Spatial autocorrelation of ϕ(x), as a function of the distance in km.B: change in odds of visit to an FFO at different distances between the context and the lunch action when the context includes 10% more FFO, obtained from the results in Table S6.C: Distribution of the distance between the context and the lunch action.The vertical dashed line corresponds to d it = exp(3.335/2.091),see TableS6, and the horizontal line in B corresponds to the value of the model in the main text for all distances (∼ 20%).

Figure S7 :
Figure S7: Left: Effect of the mobile food context ϕ in choosing an FFO using logistic regression and hot-encoding different values of ϕ.Error bars are standard errors of the coefficients.Right: Effect of the mobile food context in choosing an FFO restricted to the food outings of different sociodemographic groups.Groups are selected as quantiles of each socio-demographic variable.
visits per area (Test) D

Figure S9 :
Figure S9: Correlation between the predictions for the total number of FFO visits (A and B) and fraction of FFO visits (C and D) of our model Eq.(2) and real data for the train (A and C) and test (B and D) sets in the two different out-of-sample strategies.

Figure S17 :
Figure S17: Effect of the mobile phone context in choosing a FFO when going to a food place at lunchtime for different definitions of FFO for different attributions of the stays to the POI and the choice of the stay for the context before lunch.Values show the coefficient β of the logistic regression (log-odds) in Eq. 2) and bars indicate its standard deviation.The result in the main paper corresponds to 200m, within a 1km radius and last stay.

Figure S18 :Figure S19 :
Figure S18: Left: Effect of the mobile phone context in choosing a FFO when going to a food place at lunchtime for different definitions of FFO.The analysis is only made for the Los Angeles metropolitan area since the manual definition in (16) is only available there.Values show the coefficient of the logistic regression (log-odds) in Eq. (2), and bars indicate its standard deviation.Right: Number of FO and FFO in the different definitions of fast food outlets.
S1 Summary of the mobility data and visits in each metro area in thousands (k) or millions (M). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .S2 Combinations of other parent categories (not "Food") and categories used to classify venues as food outlets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .S3 Results for the Ordinary Least Squares regression of mobile (ϕ m i ), home (ϕ h i ) average exposure to FFO environments, and the fraction of FFO visits (µ i ) by individual, as a function of different socio-demographic traits of the census tract where individuals live.The table presents the estimated coefficients with their respective standard errors in parentheses.p-values correspond to two-sided tests for the hypothesis that each coefficient is different from zero.95% Confidence intervals for R 2 were obtained through bootstrap with 200 realizations. . . . . . . . . . . . . . . . . . . . . . . . .S4 Logistic regression results for the model in Equation (2) for different groups of users and food outings.The last column corresponds to the model in Equation (4) for the DMV visits.The table presents the estimated coefficients with their respective stan-S8 Logistic regression results for the model in Equation (2) for all actions throughout the day and different out-of-sample test settings.The table presents the estimated coefficients with their respective standard errors in parentheses.p-values correspond to two-sided tests for the hypothesis that each coefficient is different from zero.We also report the Accuracy in train and test groups and its 95% confidence interval in square brackets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
dard errors in parentheses.p-valuescorrespondto two-sided tests for the hypothesis that each coefficient is different from zero.We also report the Squared Correlation and Pseudo R 2 results for the logistic regression, and the Accuracy in the training of the model and its 95% confidence interval in square brackets. . . . . . . . . . ...S5 Logistic regression results for the model in Equation (2) for food outings happening at different distances from home (d h ).The table presents the estimated coefficients with their respective standard errors in parentheses.p-values correspond to two-sided tests for the hypothesis that each coefficient is different from zero.We also report the Squared Correlation and Pseudo R 2 results for the logistic regression. . . . . . . . .S6 Logistic regression results for the model in Equation.(3).The table presents the estimated coefficients with their respective standard errors in parentheses.p-values correspond to two-sided tests for the hypothesis that each coefficient is different from zero.Note that d it is the (log-)distance between the context and the food place where lunch happened. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .S7 Logistic regression results for the model in Equation (2) for all actions throughout the day and different out-of-sample test settings.The table presents the estimated coefficients with their respective standard errors in parentheses.p-values correspond to two-sided tests for the hypothesis that each coefficient is different from zero.We also report the Accuracy in train and test groups and its 95% confidence interval in square brackets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Table S1 :
Summary of the mobility data and visits in each metro area in thousands (k) or millions (M).

Table S5 :
Logistic regression results for the model in Equation (2) for food outings happening at different distances from home (d h ).The table presents the estimated coefficients with their respective standard errors in parentheses.p-values correspond to two-sided tests for the hypothesis that each coefficient is different from zero.We also report the Squared Correlation and Pseudo R 2 results for the logistic regression.
Clustered (day & user) standard-errors in parentheses Signif.Codes: ***: 0.01, **: 0.05, *: 0.1 Effect of the mobile food context ϕ in choosing and FFO using the logistic regression Eq. (2) by city as a function of the average value of ϕ(c it ) by city.Error bars for the mean of ϕ by city are smaller than the symbol size.thatBehavior-Environmentinterventionsare always more efficient than other interventions.Note, however, that the differences between strategies vary by city: for example, we find that Behavior-Environment interventions are particularly more effective than the rest in cities like Boston, Chicago, and Washington DC.In other cities like Philadelphia or Seattle, Behavior-Environment interventions are still more efficient than Food Hotspots but less than in the former group of cities.In all cases, though, Behavior-Environment interventions are much more efficient than the more traditional Food Swamp and Low Food Access interventions.Thus, our main result in the paper is also valid within particular cities.Total effect of each intervention strategy in each different city.Shades correspond to the number of actions changed by different income quantiles.See Figure4in the main text for more information.

Table S8 :
Logistic regression results for the model in Equation (2) for all actions throughout the day and different out-of-sample test settings.The table presents the estimated coefficients with their respective standard errors in parentheses.p-values correspond to two-sided tests for the hypothesis that each coefficient is different from zero.We also report the Accuracy in train and test groups and its 95% confidence interval in square brackets.